#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
    int flag=1;
    double pi=0,n =1;
    while(1.0/(2*n-1)>pow(10,-8)){
        pi+=1/(2*n-1)*flag;
        flag=-flag;
        n++;

    }
    pi+=1/(2*n-1);
    pi*=4;
    cout.setf(ios::fixed);
    cout << fixed <<setprecision(10)<<pi<<endl;
}
